const http = require('../utils/http')

const HTTP = new http.HTTP()

// 获取社团详情
export function getCommunity(id, callback) {
  let params = {}
  HTTP.request('/community/info/' + id, 'GET', params, res => {
    callback(res)
  })
}

// 获取社团活动
export function getActivity(id, callback) {
  let params = {}
  HTTP.request('/activity/communityActivity/' + id, 'GET', params, res => {
    callback(res)
  })
}

// 加入社团
export function addCommunity(id, callback) {
  let params = {
    communityId: id
  }
  HTTP.request('/community/joinCommunity', 'POST', params, res => {
    callback(res)
  })
}